﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Runtime.InteropServices;

    [StandardModule]
    internal sealed class BuildComboModule
    {
        public static void BuildCombo(object pObjCombo, modGeneral.ListDanhMuc pDanhMuc, bool emptyFirstRow, string Conditions = "", string textEmptyRow = "")
        {
            DataRow row;
            DataTable list;
            switch (((int) pDanhMuc))
            {
                case 1:
                    list = new clsDMNhomHangHoa().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                        list.Rows[0][1] = textEmptyRow;
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 2:
                    list = new clsDMHangHoa().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 3:
                    list = new clsDMHangSanXuat().ShowList("", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 4:
                    list = new clsDMDonViBoPhan().ShowList(Conditions, "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 5:
                    list = new clsDMDonVi().ShowList();
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 6:
                    list = new clsDMNganhKinhDoanh().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 7:
                    list = new clsDMPhuongThucThanhToan().ShowList("", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 8:
                case 0x16:
                case 0x19:
                    break;

                case 9:
                    list = new clsDMTinhThanh().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 10:
                    list = new clsDMKhuVuc().ShowList("", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 11:
                    list = new clsDMDoiTuong().ShowList("B", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 12:
                    list = new clsDMLoaiKhachHang().ShowList("", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 13:
                    list = new clsDMLoaiHoaDon().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 14:
                    list = new clsDMLoaiTien().ShowListByField("Ma|Ma", "", " TienViet Desc, Ma");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ma" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Ma" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 15:
                    list = new clsDMNhomHangHoa().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x10:
                    list = new clsDMLoaiGia().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x11:
                    list = new clsDMDonViTinh().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x12:
                    list = new clsDMChiPhi().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x13:
                    list = new clsDMLoaiTaiSan().ShowList("", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 20:
                    list = new clsDMQuocGia().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x15:
                    list = new clsDMTinhTrangTaiSan().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x17:
                    list = new clsDMViTri().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x18:
                    list = new clsDMKho().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x1a:
                    list = new clsLyDoTangGiamTaiSan().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x1b:
                    list = new clsDM_PhuTungTaiSan().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x1c:
                    list = new clsDMKhoanMucChiPhi().ShowList();
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x1d:
                    list = new clsDMLoaiNhapXuat().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 30:
                    list = new clsDMPhuongThucVanChuyen().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x1f:
                    list = new ClsNhomNguoiDung().ShowList("");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x20:
                    list = new clsDMThongSoHangHoa().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x21:
                    list = new clsDMNganhHang().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x22:
                    list = new clsDMDoiTuong().ShowList("E", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x23:
                    list = new clsDMPhuongThucTamUng().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;

                case 0x24:
                    list = new clsKhaiBaoThue().GetList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "NoiDung" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    break;

                case 0x25:
                    list = new DefaultValue().ShowLoaiIn();
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "LoaiIn" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
                    break;

                case 0x26:
                    list = new DefaultValue().ShowLoaiHoaDonIn();
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
                    break;

                case 0x27:
                    list = new clsMauHoaDon().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    if (list.Rows.Count > 0)
                    {
                        NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
                    }
                    break;

                case 40:
                    list = new clsKiHieu().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "SoKiHieu" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "SoKiHieu" }, null, null);
                    if (list.Rows.Count > 0)
                    {
                        NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
                    }
                    break;
                case 0x30:
                    list = new clsLoaiDoiTuongTapHopChiPhi().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    if (list.Rows.Count > 0)
                    {
                        NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
                    }
                    break;
                case 0x31:
                    list = new clsDMDoiTuongTapHopChiPhi().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    if (list.Rows.Count > 0)
                    {
                        NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
                    }
                    break;

                default:
                    break;
                    list = new clsDMHangSanXuat().ShowList("", "");
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;
                    list = new clsDMTinhThanh().ShowList(Conditions);
                    if (emptyFirstRow)
                    {
                        row = list.NewRow();
                        row[0] = "";
                        row[1] = textEmptyRow;
                        list.Rows.InsertAt(row, 0);
                    }
                    NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { list }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Khoa" }, null, null);
                    NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { -1 }, null, null);
                    break;
            }
        }

        public static void InitComboDatatype(object pObjCombo)
        {
            NewLateBinding.LateSet(pObjCombo, null, "DataSource", new object[] { modGeneral.H_DUNGCHUNG.ShowList("0000000008") }, null, null);
            NewLateBinding.LateSet(pObjCombo, null, "ValueMember", new object[] { "Ma" }, null, null);
            NewLateBinding.LateSet(pObjCombo, null, "DisplayMember", new object[] { "Ten" }, null, null);
            NewLateBinding.LateSet(pObjCombo, null, "SelectedIndex", new object[] { 0 }, null, null);
        }
    }
}

